package com.codeyang.feign;

import com.codeyang.domain.Basket;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述: describe
 *
 * @author CodeYang_Site
 * @version 2021/5/31 22:04
 */
@FeignClient(value = "cart-service")
public interface OrderCartFeign {

    /**
     * 远程调用购物车拿到购物车集合
     *
     * @param basketIds
     * @return
     */
    @PostMapping("p/shopCart/getBasketsByIds")
    List<Basket> getBasketsByIds(@RequestBody List<Long> basketIds);

    /**
     * 远程调用清空购物车
     * post请求只能放一个对象在body 注解不可以帮我们合并数据
     * @return
     */
    @PostMapping("p/shopCart/clearCart")
    void clearCart(@RequestParam String userId, @RequestBody ArrayList<Long> skuIds);

}


